home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / keychk11.zip / KEYCHECK.DOC < prev    next >
Text File  |  1993-06-29  |  5KB  |  121 lines

  1.  
  2.  
  3.                 █  █  ███  █   █  ███  █  █  ███  ███  █  █
  4.                 █ █   █     █ █   █    █  █  █    █    █ █
  5.                 ██    ██     █    █    ████  ██   █    ██
  6.                 █ █   █      █    █    █  █  █    █    █ █
  7.                 █  █  ███    █    ███  █  █  ███  ███  █  █
  8.  
  9.                ---------------------------------------------
  10.               |             By: David Harris                |
  11.               |      ece_0027@bigdog.engr.arizona.edu       |
  12.               |               Version 1.1                   |
  13.               |                 6/29/93                     |
  14.                ---------------------------------------------
  15.  
  16.  
  17. KEYCHECK is a utility that scans the keyboard and reports which special
  18. function keys are pressed.  By setting the command line switches, it is
  19. possible for the user to detect any combination of key presses.  It is
  20. designed to work both as a stand-alone program and as a batch utility.
  21.  
  22. Inspiration:  I was compelled to write this program because I was sick
  23. of having to wait for Windows to boot just so that I could exit back to
  24. DOS.  This simple little program makes it possible to select whether or
  25. not Windows (or any other program) will boot from your autoexec with a
  26. simple key press.
  27.  
  28. Another way that the program can be used is to select whether or not your
  29. autoexec.bat file gets executed.  There are times when we poor folks with
  30. only 640k need all the resources we can get.  The old method of getting
  31. maximum memory was rename autoexec.bat to something else and reboot - No
  32. longer. I think that a few examples might make things more clear, but first:
  33.  
  34. General syntax:
  35.                 keycheck -rlcasnpv
  36.  
  37. Command line options:
  38.           r - Right shift       c - Ctrl 
  39.           l - Left shift       a - Alt 
  40.           s - Scroll lock       n - Num lock 
  41.                   p - Caps lock            v - (verbose mode on)
  42.  
  43. First of all, without any arguments KEYCHECK will display a short help
  44. screen.  The program operates in two modes: verbose and non-verbose.
  45. The non-verbose mode is best suited for batch applications.  A 'v'
  46. anywhere in the argument will cause the program to display some useful
  47. information about the status of the special keys.
  48.  
  49. The program generates a DOS errorlevel 1 if the command line options
  50. selected match the keyboard status at run time.  Keys other than these
  51. seven are ignored.
  52.  
  53. --------------------------------------------------------------------------------
  54. EXAMPLE 1 - Selectively boot windows
  55. --------------------------------------------------------------------------------
  56.         :
  57.         :
  58.         :
  59. other autoexec.bat stuff
  60.         :
  61.         :
  62.         :
  63. keycheck -pn                               Check to see if Numlock and
  64.                                            Caps lock are on
  65. if errorlevel == 1 goto end                If they are, skip Windows
  66. win
  67.  
  68. :end
  69.  
  70. If your computer is like mine, it boots up with Num Lock on.  So now, in
  71. order to prevent windows from starting when you turn on the computer,
  72. simply press the Caps lock and you will drop right to the prompt.
  73.  
  74. --------------------------------------------------------------------------------
  75. EXAMPLE 2 - Skip autoexec.bat during start-up
  76. --------------------------------------------------------------------------------
  77. keycheck -cnv                              Check to see if the Ctrl key
  78. if errorlevel = 1 goto end                 is pressed.
  79.         :
  80.         :
  81.         :
  82. rest of autoexec junk
  83.         :
  84.         :
  85.         :
  86. :end
  87. echo Autoexec.bat has been averted.
  88.  
  89. In this case, holding down the Ctrl key during start-up will skip the
  90. entire autoexec.  As a result, no TSR's will be loaded and you'll get
  91. the maximum memory available.  Also, the program will provide you some
  92. additional info because the 'v' flag was set.  Note that I again checked
  93. for Num lock.
  94.  
  95. --------------------------------------------------------------------------------
  96. EXAMPLE 3 - Selectively booting multiple programs
  97. --------------------------------------------------------------------------------
  98. ...Somewhere in autoexec.bat...
  99.  
  100. keycheck -cn
  101. if errorlevel == 1 procomm              Executes procomm upon Ctrl press
  102.  
  103. keycheck -an
  104. if errorlevel == 1 wp51                 Executes Wordperfect upon Alt
  105.  
  106. keycheck -rca == 1 \games\fs4           Starts flight simulator if you
  107.                                         hold down RightShift-Ctrl-Alt
  108.                                         during startup.
  109.  
  110. With some minor changes to your autoexec (or any other bat file), you
  111. will soon be on your way.  Good Luck!  Please let me know what you think
  112. of this program.  This is the first time I have released a program to
  113. the public, so I would appreciate any feedback regarding improvements
  114. and bugs and whatever.  I hope that you find it useful.
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.